import java.io.File;
import java.io.FileWriter;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Set;

import org.junit.Test;

import com.gregbugaj.reflector.renderer.AbstractRenderer;
import com.gregbugaj.reflector.renderer.TreeRenderer;
import com.gregbugaj.reflector.visitors.AbstractVisitor;
import com.gregbugaj.reflector.visitors.JSFDumpContext;
import com.gregbugaj.reflector.visitors.XMLVisitor;
import com.jsfcomponent.domain.Bee;
import com.jsfcomponent.domain.Honey;




public class HashTester {
	@Test
	public void testHashes(){
              /*
		Honey honey=new Honey();
		//honey.setName("Honey Taste");
		
		Bee bee = new Bee();
		bee.setName("Angry Bee");     
		bee.setId(10);
		
		Bee bee2 = new Bee();
		bee2.setName("Angry Bee2");

		bee.setHoney(honey);
		bee2.setHoney(honey);

		Set setA=new HashSet();
		setA.add(bee);
		setA.add(bee2);

		Set beeCollection = UnmodifiableSet.decorate(setA);
		honey.setBeeCollection(beeCollection);
		

		XStream xstream = new XStream();

		String out=xstream.toXML(honey);

		AbstractVisitor visitor = new XMLVisitor();
		visitor.visit(honey);
			
		
		try {
			JSFDumpContext context = visitor.getContext();			
			context.print();

			AbstractRenderer renderer=new TreeRenderer();
			renderer.render(context);

			FileWriter writer = new FileWriter(new File("c:\\temp_render.htm"));

			String template="/templates/template.txt";
			InputStream stream = this.getClass().getResourceAsStream(template);

			int result=-1;
			StringBuffer sb=new StringBuffer();
			while((result=stream.read())!=-1){
				sb.append((char)result);
			}
			String tempCode=sb.toString();
			tempCode = tempCode.replaceAll("\\{output\\}", renderer.getBufferToString());	
			writer.write(tempCode);
			writer.close();

		} catch (Exception e) {
			e.printStackTrace();
		}
                */
	}
}
